import 'package:flutter2/generated/json/base/json_convert_content.dart';
import 'package:flutter2/model/user_entity.dart';

UserEntity $UserEntityFromJson(Map<String, dynamic> json) {
  final UserEntity userEntity = UserEntity();
  final int? unmarriedexplainaggressionpatience = jsonConvert.convert<int>(json['unmarriedexplainaggressionpatience']);
  if (unmarriedexplainaggressionpatience != null) {
    userEntity.unmarriedexplainaggressionpatience = unmarriedexplainaggressionpatience;
  }
  final String? waistchairwomanpilechoose = jsonConvert.convert<String>(json['waistchairwomanpilechoose']);
  if (waistchairwomanpilechoose != null) {
    userEntity.waistchairwomanpilechoose = waistchairwomanpilechoose;
  }
  final int? userId = jsonConvert.convert<int>(json['evenwebsiteprinciple']);
  if (userId != null) {
    userEntity.userId = userId;
  }
  final String? token = jsonConvert.convert<String>(json['becomecushionchickchinese']);
  if (token != null) {
    userEntity.token = token;
  }
  final String? phone = jsonConvert.convert<String>(json['phone']);
  if (phone != null) {
    userEntity.phone = phone;
  }
  return userEntity;
}

Map<String, dynamic> $UserEntityToJson(UserEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['unmarriedexplainaggressionpatience'] = entity.unmarriedexplainaggressionpatience;
  data['waistchairwomanpilechoose'] = entity.waistchairwomanpilechoose;
  data['evenwebsiteprinciple'] = entity.userId;
  data['becomecushionchickchinese'] = entity.token;
  data['phone'] = entity.phone;
  return data;
}

extension UserEntityExtension on UserEntity {
  UserEntity copyWith({
    int? unmarriedexplainaggressionpatience,
    String? waistchairwomanpilechoose,
    int? userId,
    String? token,
    String? phone,
  }) {
    return UserEntity()
      ..unmarriedexplainaggressionpatience =
          unmarriedexplainaggressionpatience ?? this.unmarriedexplainaggressionpatience
      ..waistchairwomanpilechoose = waistchairwomanpilechoose ?? this.waistchairwomanpilechoose
      ..userId = userId ?? this.userId
      ..token = token ?? this.token
      ..phone = phone ?? this.phone;
  }
}
